package com.example.questionnairespringboot.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.questionnairespringboot.entity.User;
import com.example.questionnairespringboot.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

@Service
public class UserService extends ServiceImpl<UserMapper,User> {
    public boolean saveUser(User user){
/*        if(user.getId()==null){
            return save(user);
        }
        else{
            return updateById(user);
        }*/
        return saveOrUpdate(user);
    }

/*    @Autowired
    private UserMapper userMapper;
    public int save (User user){
        if(user.getId()==null){
            return userMapper.insert(user);
        }
        else{
            return userMapper.update(user);
        }
    }*/
}
